#include <stdio.h>
#include <malloc.h>
#include"..\Stack\zyf_Stack.h"
#define ERROR 2
#define OK 1
typedef int Status;

/*
	使用两个栈模拟队列
*/
typedef struct queue
{
	SqStack *S1,*S2;
}Queue;

//初始化队列，即初始化两次栈
Status Init_CirQueue(Queue *Q)
{
	int i,j
	i = Init_Stack(Q -> S1);
	j = Init_Stack(Q -> S2);
	if (i == 1 && j == 1)
		return OK;
	else
		return ERROR;
}

//入队
Status Insert_CirQueue(SqQueue Q,ElemType e)
{
	if (OverflowStack(Q.S2) == 1)
		return ERROR;

	while (EmptyStack(Q.S2) == 2)
	{
		int *i;
		push(Q.S2,*i);
		pop(Q.S1,i);
	}

	pop(Q.S1,e);

	while (EmptyStack(Q.S1) == 2)
	{
		int *i;
		push(Q.S1,*i);
		pop(Q.S2,i);
	}

	return OK;
}

//出队
Status Delete_CirQueue(SqQueue Q,ElemType *e)
{
	if (EmptyStack(Q.S2) == 1)
		return ERROR;
	int *i;
	pop(Q.S2,i);
	*e = *i;

	return OK;
}